﻿<common:ViewBase x:Class="Ultimate.Home.Views.HomeSubView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:common="http://schemas.ultimatedemo.com/2012/xaml/presentation"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:prism="http://www.codeplex.com/prism"
    xmlns:ultimate="http://schemas.ultimatenavigationframework.com/2011/xaml/presentation"     
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="DarkGreen" >
        <StackPanel>
            <TextBlock FontSize="20" Foreground="White">
                <Run Text="Home - Sub View "/>                
                <Run Text="{Binding Id}"/>
            </TextBlock>
            <TextBlock FontSize="12" Text="This is the home sub view frame" Foreground="White"/>
            <StackPanel Orientation="Horizontal">
                <HyperlinkButton Content="Inner View 1" 
                                 ultimate:NavigationClick.EventName="Click"
                                 ultimate:NavigationClick.Command="{Binding NavigateCommand}"
                                 ultimate:NavigationClick.Url="/Home/Sub/{0}/Inner/{1}"
                                 ultimate:NavigationClick.FormatParam1="{Binding Id}"
                                 ultimate:NavigationClick.FormatParam2="1"
                                 />
                <HyperlinkButton Content="Inner View 2" 
                                 ultimate:NavigationClick.EventName="Click"
                                 ultimate:NavigationClick.Command="{Binding NavigateCommand}"
                                 ultimate:NavigationClick.Url="/Home/Sub/{0}/Inner/{1}"
                                 ultimate:NavigationClick.FormatParam1="{Binding Id}"
                                 ultimate:NavigationClick.FormatParam2="2"
                                 />
            </StackPanel>
            <toolkit:BusyIndicator Grid.Row="1"         
                               BusyContent="{Binding ProgressValue, ElementName=MainFrame}"
                               IsBusy="{Binding IsBusy, ElementName=MainFrame}">
                <!--Note: RegionName must be unique across application-->
                <ultimate:UltimateNavigationFrame x:Name="MainFrame"
                                                  NavigationFailed="Frame_NavigationFailed"
                                                  prism:RegionManager.RegionName="{Binding RegionName}"> 
                    <ultimate:UltimateNavigationFrame.UriMapper>
                        <ultimate:UltimateNavigationUriMapper>
                            <ultimate:UltimateNavigationUriMapping Uri="/Home/Sub/{id}/Inner/{innerId}"
                                                               MappedUri="/HomeSubInnerView?id={innerId}" />
                        </ultimate:UltimateNavigationUriMapper>
                    </ultimate:UltimateNavigationFrame.UriMapper>
                    <!--Handles all exception to ErrorView-->
                    <ultimate:ErrorPage ErrorPageUri="/ErrorView"
                                      ExceptionType="Exception" />
                </ultimate:UltimateNavigationFrame>
            </toolkit:BusyIndicator>
        </StackPanel>
    </Grid>
</common:ViewBase>
